// 数据报表相关接口mock数据
export const mockDataReports = {
  // 获取报表筛选选项
  getFilterOptions: {
    reportTypes: [
      { value: '1', label: '业务办理统计' },
      { value: '2', label: '窗口服务统计' },
      { value: '3', label: '用户满意度' },
      { value: '4', label: '设备使用情况' }
    ],
    timeRanges: [
      { value: '1', label: '今日' },
      { value: '2', label: '本周' },
      { value: '3', label: '本月' },
      { value: '4', label: '本季度' },
      { value: '5', label: '本年' },
      { value: '6', label: '自定义' }
    ],
    departments: [
      { value: '', label: '全部部门' },
      { value: '1', label: '校务处' },
      { value: '2', label: '教务处' },
      { value: '3', label: '学生处' },
      { value: '4', label: '财务处' }
    ]
  },

  // 业务办理量趋势数据
  getBusinessVolumeTrend: {
    period: '2023年8月',
    chartData: {
      categories: ['8/1', '8/2', '8/3', '8/4', '8/5', '8/6', '8/7', '8/8', '8/9', '8/10', '8/11', '8/12', '8/13', '8/14', '8/15', '8/16', '8/17', '8/18', '8/19', '8/20', '8/21', '8/22', '8/23', '8/24', '8/25', '8/26', '8/27', '8/28', '8/29', '8/30', '8/31'],
      series: [
        {
          name: '办理量',
          data: [45, 52, 38, 61, 55, 48, 42, 58, 63, 47, 51, 44, 56, 49, 53, 47, 59, 46, 52, 48, 55, 51, 44, 57, 49, 53, 47, 58, 46, 52, 48]
        }
      ]
    },
    summary: {
      totalVolume: 328,
      dailyAverage: 42,
      monthOverMonth: '+12%',
      topDepartment: '教务处'
    }
  },

  // 窗口服务统计数据
  getWindowServiceStats: {
    period: '2023年8月',
    chartData: {
      categories: ['1号窗口', '2号窗口', '3号窗口', '4号窗口', '5号窗口'],
      series: [
        {
          name: '办理量',
          data: [65, 78, 52, 45, 38]
        }
      ]
    },
    summary: {
      avgWaitTime: 15.2,
      avgProcessTime: 8.7,
      busiestWindow: '2号窗口',
      topStaff: '李四'
    }
  },

  // 用户满意度数据
  getUserSatisfaction: {
    period: '2023年8月',
    chartData: {
      categories: ['8/1', '8/2', '8/3', '8/4', '8/5', '8/6', '8/7', '8/8', '8/9', '8/10', '8/11', '8/12', '8/13', '8/14', '8/15', '8/16', '8/17', '8/18', '8/19', '8/20', '8/21', '8/22', '8/23', '8/24', '8/25', '8/26', '8/27', '8/28', '8/29', '8/30', '8/31'],
      series: [
        {
          name: '满意度',
          data: [92, 89, 94, 91, 88, 93, 90, 95, 87, 92, 89, 91, 93, 88, 90, 94, 87, 92, 89, 91, 93, 88, 90, 94, 87, 92, 89, 91, 93, 88, 90]
        }
      ]
    },
    summary: {
      avgSatisfaction: '92%',
      avgRating: 4.6,
      unsatisfiedCount: 3,
      topRatedStaff: '王五'
    }
  },

  // 热门业务TOP5数据
  getTopBusinessServices: {
    period: '2023年8月',
    data: [
      { type: '学籍证明', count: 128, percentage: '39%' },
      { type: '成绩单打印', count: 85, percentage: '26%' },
      { type: '学费缴纳', count: 52, percentage: '16%' },
      { type: '宿舍申请', count: 32, percentage: '10%' },
      { type: '校园卡补办', count: 21, percentage: '6%' }
    ]
  }
}

// Mock API响应函数
export const mockApiResponses = {
  // 获取筛选选项
  getFilterOptions: () => {
    return new Promise((resolve) => {
      console.log('Mock API: getFilterOptions 被调用')
      setTimeout(() => {
        const response = {
          code: 200,
          message: '获取成功',
          data: mockDataReports.getFilterOptions
        }
        console.log('Mock API: getFilterOptions 响应:', response)
        resolve(response)
      }, 300)
    })
  },

  // 获取业务办理量趋势
  getBusinessVolumeTrend: (params) => {
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve({
          code: 200,
          message: '获取成功',
          data: mockDataReports.getBusinessVolumeTrend
        })
      }, 500)
    })
  },

  // 获取窗口服务统计
  getWindowServiceStats: (params) => {
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve({
          code: 200,
          message: '获取成功',
          data: mockDataReports.getWindowServiceStats
        })
      }, 500)
    })
  },

  // 获取用户满意度
  getUserSatisfaction: (params) => {
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve({
          code: 200,
          message: '获取成功',
          data: mockDataReports.getUserSatisfaction
        })
      }, 500)
    })
  },

  // 获取热门业务TOP5
  getTopBusinessServices: (params) => {
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve({
          code: 200,
          message: '获取成功',
          data: mockDataReports.getTopBusinessServices
        })
      }, 400)
    })
  },

  // 导出报表
  exportReport: (params) => {
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve({
          code: 200,
          message: '导出成功',
          data: {
            downloadUrl: '/api/reports/export/data-reports.xlsx',
            fileName: `数据报表_${new Date().toISOString().slice(0, 10)}.xlsx`
          }
        })
      }, 1000)
    })
  }
}
